package com.mach.platform.domain.iot;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigInteger;


/**
 *
 * 设备属性 实体
 * The persistent class for the iot_coll_items database table.
 *
 */
@Data
@NoArgsConstructor
@JsonIgnoreProperties(value = { "hibernateLazyInitializer", "handler" })
@Entity
@Table(name="iot_coll_items")
@NamedQuery(name="IotCollItem.findAll", query="SELECT i FROM IotCollItem i")
public class IotCollItem implements Serializable {
	private static final long serialVersionUID = 1L;

	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Id
	private Long id;

	@Column(name="data_len")
	private int dataLen;

	@Column(name="is_get")
	private int isGet;

	private String name;

	/**
	 * 记录数据类型 ，Integer，float 此类
	 */
	@Column(name="data_type")
	private String dataType;

	/**
	 * 属性类别，100 数据，101 开关，103 其他，诸如此类
	 */
	@Column(name = "property_type")
	private Integer propertyType;

	/**
	 * 值类型
	 */
	@Column(name = "value_type", columnDefinition = "INT default 100")
	private int valueType;

	/**
	 * 寄存器数量
	 */
	@Column(name = "saver_num", columnDefinition = "INT default 1")
	private int saverNum;

	/**
	 * 数据 单位
	 */
	private String unit;

	/**
	 * 属性类型  ：温度？压力？流量？露点？
	 */
	private String type;

	@Column(name="value_addr")
	private BigInteger valueAddr;

	@Column(name="value_addr_str")
	private String valueAddrStr;

	/**
	 * 报警下限值
	 */
	@Column(name="warn_down")
	private double warnDown;

	/**
	 * 报警上限值
	 */
	@Column(name="warn_up")
	private double warnUp;


	/**
	 * 指令
	 */
	@Column(name="fun_code", columnDefinition = "int default 3")
	private int funCode;
	/**
	 *等待时间
	 */
	@Column(name="wait_time", columnDefinition = "int default 500")
	private int waitTime;

}
